home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / desktop / wspacer.zip / WSRUN.WBT < prev   
Text File  |  1991-09-13  |  2KB  |  55 lines

  1. ; --- This is WSRUN.WBT (a Batch Builder file that restores a named
  2. ;     WorkSpace to the desktop).  WSMAKE.WBT (a Batch Builder file that
  3. ;     obtains WorkSpace information, storing it in a private INI file)
  4. ;     is paired with WSRUN.WBT to complete WorkSpacer.
  5.  
  6. ; --- WiGuys Software
  7. ;     19 Rushbrook Drive,
  8. ;     Kitchener, ON N2E 3C1 Canada
  9. ;     (519) 745-9717
  10. ;     Gregg Hommel, CIS # 72537,552
  11. ; --- WorkSpacer is freeware.
  12.  
  13. ; --- Does WSPACE.LIB exist. If not, call WSMAKE.WBT to create it.
  14.  
  15. WinHide ( "WBT" )
  16. If FileExist ( "wspace.lib" ) Then GoTo start
  17. CallExt ( "wsmake.wbt", "" )
  18. Return
  19.  
  20. :start         ; choose a workspace
  21. space = TextBox ( "Select a WorkSpace", "wspace.lib" )
  22. If !StrICmp ( space, "" ) == 0 Then GoTo wsname
  23. Message ( "WorkSpacer Warning", "Nothing was selected!" )
  24. GoTo start
  25.  
  26. :wsname
  27. count = 1
  28. maxrun = 4     ; --- Default for maximum # of applications.
  29.  
  30. :checkappdata       ; Read WSPACE.INI for app data
  31. getapp = StrCat ( "App", count )
  32. app = IniReadPvt ( space, getapp, "None", "wspace.ini" )
  33. If !StrICmp ( app, "None" ) == 0 Then GoTo readinirest
  34. If count == 1 Then GoTo oops
  35. GoTo fini
  36.  
  37. :readinirest
  38. getpos = StrCat ( "Pos", count )
  39. pos = IniReadPvt ( space, getpos, "None", "wspace.ini" )
  40. getwin = StrCat ( "Win", count )
  41. winame = IniReadPvt ( space, getwin, "None", "wspace.ini" )
  42.  
  43. If !WinExist ( winame) Then Run (app, "")     ; Load the app
  44. WinPlace ( %pos%, winame )
  45. If count == maxrun Then GoTo fini
  46. count = count + 1
  47. GoTo checkappdata
  48.  
  49. :oops          ; Error message
  50. Message ( "Sorry", "The INI file does not list the correct information." )
  51.  
  52. :fini
  53. Return
  54.  
  55.